@import "./revision-indicator.less";

.compare-selection {
  &:extend(.flex);
  align-items: center;

  position: sticky;
  top: 55px;
  z-index: 1000;

  // for the sticky state, we need a solid background
  // and padding around the controls
  background: #f7f7f7;
  border-bottom: 1px solid #ddd;
  padding: 10px 0;
  margin: -10px 0 -1px 0;

  .actions {
    margin-left: auto;
    margin-right: 0;

    a {
      position: relative;
      top: -1px; // not sure why the <a> are showing up lower but they are -prf
    }
  }

  > * {
    margin-right: 10px;
  }

  .fa-arrow-right {
    -webkit-text-stroke: 1px #fff;
  }

  .dropdown.open .toggleable:not(.primary) {
    border: 1px solid transparent;
  }

  .favicon {
    width: 16px;
    height: 16px;
    margin-right: 5px;
  }
}

.compare-footer {
  &:extend(.flex);
  align-items: center;
  justify-content: space-between;
  position: sticky;
  bottom: 0;
  background: #f7f7f7;
  border-top: 1px solid #ddd;
  margin-top: -1px;
  padding: 10px 0;

  .links {
    margin-left: auto;

    .separator {
      margin: 0 3px;
      color: @color-text--muted;
      color: rgba(0,0,0,.5);
    }
  }

  .separator {
    margin: 0 5px;
    color: rgba(0,0,0,.3);
  }
}

.revisions-count {
  font-weight: 500;
}

.archive-comparison {

  .archive-comparison-header {
    display: none;
    &:extend(.flex);
    flex-wrap: nowrap;
    align-items: center;
    margin-bottom: 10px;

    .change-count {
      font-weight: 600;
      padding-left: 4px;
    }

    .view {
      margin-left: 7px;
    }

    .actions {
      margin-left: auto;
    }
  }

  .empty {
    // TODO need to make generic module class
    position: relative;
    padding: 15px;
    background: #fff;
    border: 1px solid #ddd;

    .empty-header {
      &:extend(.flex);
      align-items: center;
      margin-bottom: 5px;
    }

    .open-link {
      position: absolute;
      right: 15px;
      top: 50%;
      transform: translateY(-50%);
    }

    i {
      font-size: 70px;

      &.fa {
        width: 25px;
        margin-right: 10px;
        font-size: 22px;
        color: shade(@green, 15%);
        -webkit-text-stroke: 1px #fff;
      }
    }

    .label {
      font-size: 1rem;
      font-weight: 500;
    }

    .empty-description {
      color: @color-text;
      font-size: .85rem;
      max-width: ~"calc(100% - 220px)";
      margin: 0 0 0 35px;

      &:last-child {
        margin-bottom: 0;
      }
    }

    .delete-draft-btn {
      width: 100%;
      margin-top: 15px;

      @media (min-width: 700px) {
        position: absolute;
        width: auto;
        right: 25px;
        top: 50%;
        transform: translateY(-50%);
        margin-top: 0;
      }
    }

    a:not(.btn) {
      color: @blue;

      &:hover {
        text-decoration: underline;
      }
    }
  }

  .archive-comparison-list {
    margin-left: 0;
    padding-left: 0;
  }

  .revision {
    list-style: none;

    &:not(:last-child) {
      margin-bottom: 10px;
    }

    .revision-header {
      padding: 0 15px;

      .path {
        font-weight: 500;
      }

      &:hover {
        cursor: pointer;

        .path {
          text-decoration: underline;
        }

        .ignore-btn {
          // TODO reinstate the add to .datignore button
          visibility: visible;
        }
      }

      a {
        color: initial;

        &:hover {
          text-decoration: none;
        }
      }

      .revision-indicator {
        margin-right: 7px;
      }

      .actions {
        margin-left: auto;

        .btn {
          margin-left: 5px;
        }
      }

      .ignore-btn {
        visibility: hidden;
      }

      .changes-count {
        font-weight: 700;
        letter-spacing: .1px;
        font-size: .75rem;
        margin-right: 5px;

        &.additions {
          color: shade(@green, 20%);
        }

        &.deletions {
          color: shade(@red, 20%);
        }
      }
    }

    .revision-content {
      border: 1px solid #ddd;
      border-top: 0;
      border-radius: 0 0 2px 2px;
      background: #fff;

      .empty {
        border: 0;
      }

      .empty,
      .source-too-large,
      .folder,
      .loading {
        text-align: center;
        padding: 20px 0;

        p {
          margin-top: 0;

          &:last-child {
            margin-bottom: 0;
          }
        }

        .fa {
          font-size: 48px;
          color: rgba(0,0,0,.15);
          margin-bottom: 10px;
        }
      }

      .spinner {
        width: 30px;
        height: 30px;
        margin: auto;
      }
    }
  }
}